package org.dylan.bdf.system.controller;

import javax.servlet.http.HttpSession;

import org.dylan.web.util.RequestHolder;
import org.dylan.web.util.WebConstants;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/system")
public class SystemController {
	/**
	 * 更改当前session范围的主题样式
	 * 
	 * @param theme
	 */
	@RequestMapping("/theme")
	@ResponseBody
	public String selectTheme(String theme) {
		HttpSession session = RequestHolder.getSession();
		session.setAttribute(WebConstants.SESSION_ATTRIBUTE_THEME, theme);
		return "success";
	}
}
